/**
 * 
 */
package com.feib.stms.action;

import java.util.ArrayList;
import java.util.Calendar;

import net.sourceforge.stripes.integration.spring.SpringBean;

import com.feib.stms.dao.DeliveryPaymentDao;
import com.feib.stms.model.DeliveryPayment;
import com.feib.stms.model.UploadFile;
import com.feib.stms.service.BasePaymentFileContentService;
import com.feib.stms.service.DeliveryPaymentService;


/**
 * @title (#)Stms2005ActionBean.java<br>
 * @description 交割款明細查詢/報表/下載 Controller<br/>
 * <ul>
 * <li>需求說明: 使用者查詢/列印報表/下載交割款明細資料。</li>
 * <li>使用單位及角色:
 * <ol>
 * <li>券商端。</li>
 * <li>遠銀分行。</li>
 * </ol></li>
 * </ul>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2012/04/19
 * @copyright Far Eastern International Bank Copyright (c) 2012<br>
 * @2012/05/31 create by Jimmy Liu<br>
 */
public class Stms2005ActionBean extends BaseQueryUploadFileActionBean<DeliveryPaymentService, DeliveryPaymentDao, DeliveryPayment>
{

	private static final long serialVersionUID = 2808530632669072099L;
	
	private static final String DEFAULT_JSP = "/WEB-INF/views/stms2005/stms2005.jsp";
	
	private static final String SHOW_MODAL_DIALOG_JSP = "/WEB-INF/views/stms2005/stms2005ShowModalDialog.jsp";
	
	public Stms2005ActionBean() {
		super();
		super.fileFormats = new ArrayList<String>();
		super.fileFormats.add(getUploadFileFormat());
	}	

	@Override
	protected String getDefaultPage() {
		return DEFAULT_JSP;
	}
	
	@Override
	public String getUploadFileFormat() {
		return UploadFile.UPLOAD_FILE_DELIVERY_PAYMENT;
	}

	@Override
	@SpringBean("deliveryPaymentService")
	protected void setPaymentFileContentService(
			BasePaymentFileContentService<DeliveryPaymentDao, DeliveryPayment> paymentFileContentService) {
		this.paymentFileContentService = paymentFileContentService;
	}

	@Override
	public String getDownloadFileName() {
		return "交割款明細表_"+yyyyMMddHHmmSS.format(Calendar.getInstance().getTime())+".xls";
	}

	@Override
	protected String getShowModalDialogPage() {
		return SHOW_MODAL_DIALOG_JSP;
	}
}
